package com.cdm.forum.dao;

import com.cdm.forum.model.Message;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MessageMapper {
    int insert(Message record);

    int insertSelective(Message record);

    Message selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Message record);

    int updateByPrimaryKey(Message record);

    //根据用户id查询用户未读数
    Integer selectUnreadCount(Long receiveUserId);

    /**
     * 根据接收者用户id查询信息列表
     * @param receiveUserId 接收者用户id
     * @return
     */
    List<Message> selectByReceiveUserId(@Param("receiveUserId") Long receiveUserId);


}